#include"Gun.h"
#include"Solider.h"

Gun::Gun(std::string type)
{
    this-> _type = type;
}

void Gun::addBullet(int bullet_num)
{
    this->_bullet_count += bullet_num;
    std::cout<<"当前子弹数量为= "<<bullet_num<<std::endl;

}

bool Gun::shoot()
{
    if(this->_bullet_count<=0)
    {
        std::cout<<"枪里没有子弹了"<<std::endl;
        return false;
    }
    this->_bullet_count-=1;
    std::cout<<"当前子弹的数量为:"<<_bullet_count<<std::endl;
    return true;
}

